//
//  UIView+FindFirstResponder.m
//  CashierCounter1.7
//
//  Created by zhangqing3 on 12-10-15.
//  Copyright (c) 2012年 UMPAY. All rights reserved.
//

#import "UIView+FindFirstResponder.h"

@implementation UIView (FindFirstResponder)
//遍历当前页面中全部控件，找出第一响应者返回
- (UIView *)findFirstResponder
{
    if (self.isFirstResponder) {        
        return self;     
    }
    
    for (UIView *subView in self.subviews) {
        UIView *_firstResponder = [subView findFirstResponder];
        
        if (_firstResponder != nil) {
            return _firstResponder;
        }
    }
    
    return nil;
}

@end
